package com.hongdee.scm.appAmount.controller;

import com.hongdee.scm.appAmount.service.ITScmAmountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/9/11.
 */
@RestController
@RequestMapping("/scm/appAmount")
public class TScmAmontController {

    @Autowired
    private ITScmAmountService itScmAmountService;

    @RequestMapping("/queryMaAll")
    @ResponseBody
    public Map queryMaAll(@RequestParam(name = "uid", defaultValue = "") String uid,
                          @RequestParam(name = "token", defaultValue = "") String token,
                          @RequestBody Map data
                          ) throws Exception{

        List dataList = this.itScmAmountService.queryQuanju(data,uid);
        Map map = new HashMap();
        map.put("success",true);
        map.put("msg","查询成功");
        map.put("dataList",dataList);
        return map;
    }

    @RequestMapping("/queryMaBrand")
    @ResponseBody
    public Map queryMaBrand(@RequestParam(name = "uid", defaultValue = "") String uid,
                            @RequestParam(name = "token", defaultValue = "") String token,
                            @RequestBody Map data
    ) throws Exception{

        List dataList = this.itScmAmountService.queryBrand(data,uid);
        Map map = new HashMap();
        map.put("success",true);
        map.put("msg","查询成功");
        map.put("dataList",dataList);
        return map;
    }

    @RequestMapping("/queryMaCompany")
    @ResponseBody
    public Map queryMaCompany(@RequestParam(name = "uid", defaultValue = "") String uid,
                             @RequestParam(name = "token", defaultValue = "") String token,
                             @RequestBody Map data
    ) throws Exception{

        List dataList = this.itScmAmountService.queryCompany(data,uid);
        Map map = new HashMap();
        map.put("success",true);
        map.put("msg","查询成功");
        map.put("dataList",dataList);
        return map;
    }
}
